package by.jtraining.london.service;

import java.util.List;

import by.jtraining.london.repo.PersistModule;
import by.jtraining.london.service.impl.UserServiceImpl;
import by.jtraining.london.service.impl.AdminServiceImpl;
import by.jtraining.london.service.impl.LectorServiceImpl;
import by.jtraining.london.service.impl.StudentServiceImpl;
import by.jtraining.london.service.provider.CourseListProvider;
import by.jtraining.london.service.provider.EducationListProvider;

import com.google.inject.AbstractModule;
import com.google.inject.TypeLiteral;
import com.google.inject.name.Names;

public class ServiceModule extends AbstractModule{

	@Override
	protected void configure() {
		install(new PersistModule());
		
		  bind(StudentService.class).to(StudentServiceImpl.class);
 		  bind(LectorService.class).to(LectorServiceImpl.class);
		  bind(AdminService.class).to(AdminServiceImpl.class);
		  bind(UserService.class).to(UserServiceImpl.class);
		  
		  bind(new TypeLiteral<List<String>>(){})
	  			.annotatedWith(Names.named("courseList"))
	  			.toProvider(CourseListProvider.class);
		  bind(new TypeLiteral<List<String>>(){})
				.annotatedWith(Names.named("educationList"))
				.toProvider(EducationListProvider.class);
	}
}
